﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/admin.master" AutoEventWireup="true"
    CodeFile="edit.aspx.cs" Inherits="aspx_admin_news_edit" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Title" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="新闻ID" DataSourceID="ods新闻中心"
        DefaultMode="Edit"
        OnItemCommand="FormView1_ItemCommand"
        OnItemUpdated="FormView1_ItemUpdated" Width="100%">
        <EditItemTemplate>
            <table width="100%">
                <tr>
                    <td>标题
                    </td>
                    <td>
                        <asp:TextBox ID="标题TextBox" runat="server" Text='<%# Bind("标题") %>' Columns="50"
                            CausesValidation="true" /><asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                                ErrorMessage="*" ControlToValidate="标题TextBox" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>发布者
                    </td>
                    <td>
                        <asp:TextBox ID="发布者TextBox" runat="server" Text='<%# Bind("发布者") %>' Columns="50"
                            CausesValidation="true" /><asp:RequiredFieldValidator ID="RequiredFieldValidator2"
                                ErrorMessage="*" ControlToValidate="发布者TextBox" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>发布时间
                    </td>
                    <td>
                        <asp:TextBox ID="发布时间TextBox" runat="server" Text='<%# Bind("发布时间") %>' CssClass="date"
                            Columns="50" /><asp:RequiredFieldValidator ID="RequiredFieldValidator3" ErrorMessage="*"
                                ControlToValidate="发布时间TextBox" runat="server" />
                    </td>
                </tr>
              
                <tr>
                    <td>重要性值</td>
                    <td>
                        <asp:TextBox Text='<%# Bind("重要性") %>' runat="server" ID="txt重要性" />
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                         <asp:CheckBox ID="显示CheckBox" runat="server" Checked='<%# Bind("显示") %>' Text="显示在网页上"/>
                        <asp:CheckBox Checked='<%# Bind("新") %>' runat="server" ID="ccb新" Text="标记为new" />
                        <asp:CheckBox Checked='<%# Bind("置顶") %>' runat="server" ID="ccb置顶" Text="置顶" />
                        <asp:CheckBox Checked='<%# Bind("红字") %>' runat="server" ID="CheckBox1" Text="红字" />
                    </td>
                </tr>
                
                <tr>
                    <td colspan="2">内容:
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ErrorMessage="*" ControlToValidate="内容TextBox"
                            runat="server" Display="Dynamic" />
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                            Text="更新" CssClass="btn" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"
                            CommandName="Cancel" Text="取消" CssClass="btn" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:TextBox ID="内容TextBox" runat="server" Text='<%# Bind("内容") %>' TextMode="MultiLine"
                            Columns="80" Rows="16" CausesValidation="true" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2"></td>
                </tr>
            </table>
        </EditItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="ods新闻中心" runat="server"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataBy新闻ID" TypeName="ds_名师讲堂TableAdapters.tb_新闻中心TableAdapter"
        UpdateMethod="Update">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="新闻ID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="标题" Type="String" />
            <asp:Parameter Name="内容" Type="String" />
            <asp:Parameter Name="发布者" Type="String" />
            <asp:Parameter Name="发布时间" Type="DateTime" />
            <asp:Parameter Name="显示" Type="Boolean" />
            <asp:Parameter Name="置顶" Type="Boolean" />
            <asp:Parameter Name="新" Type="Boolean" />
            <asp:Parameter Name="红字" Type="Boolean" />
            <asp:Parameter Name="重要性" Type="Single" />
            <asp:Parameter Name="Original_新闻ID" Type="Int32" />
        </UpdateParameters>
    </asp:ObjectDataSource>
</asp:Content>